home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Add-Ons / MicroPhone / Open Mike™ / Open Mike™ 009 / Mike's Folder / XFCN Mania II < prev   
Encoding:
Text File  |  1993-09-01  |  2.5 KB  |  35 lines  |  [TEXT/ttxt]

  1. XFCN Mania II
  2. =============
  3. Copyright © 1993 by Celestin Company
  4. All rights reserved.
  5.  
  6. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without permission in writing from the publisher. However, you are permitted to make copies of this work, printed or otherwise, as long as said copies are for your personal use only.
  7.  
  8. Introduction
  9. ------------
  10. XFCN Mania II brings you three useful XFCNs that you can install into your MPToolBox. The following XFCNs are included: CRCValue returns a CRC value for a given piece of text. You can use a CRC to compare two different pieces of text to see if they are identical. ROT13 will encrypt or decrypt a piece of text, using the popular ROT13 technique. CharCount will return the number of times the specified character appears in a given piece of text.
  11.  
  12. Installation
  13. ------------
  14. To install the XFCNs, open up the XFCN Mania settings document with ResEdit or another resource editor. Select the XFCN you want and copy it. Open MPToolBox with ResEdit and paste the XFCN. Save the changes to MPToolBox and quit ResEdit. That's it. Now, the new XFCN will show up in the list of XFCNs in MicroPhone's Script Editor.
  15.  
  16. CRCValue - pass the XFCN a string of text. It will return a 16 bit CRC value for the text. Store this number in a variable. Later, pass CRCValue another string of text. Compare the new CRC value with the number you stored to see if the two strings match. If they do, they'll have the same CRC value. This XFCN comes in handly in situations where you have limited memory and you potentially have really big strings you want to compare. You may not have enough memory to keep a copy of each string in memory, but with CRCValue, you won't need to.
  17.  
  18. Example:
  19.  
  20.   Set Variable * test from Expression "CRCValue('special information')"
  21.  
  22. ROT13 - pass the XFCN a string of text. It will return the text with each character rotated by 13. For example, the letter A will return as the letter N. Use ROT13 to hide information from potentially sensitive readers.
  23.  
  24. Example:
  25.  
  26.   Set Variable * test from Expression "ROT13('this is secret text')"
  27.  
  28. CharCount - pass the XFCN the character to look for as the first parameter. Pass the complete text as the second parameter. It will return the number of times the specified character appears.
  29.  
  30. Example:
  31.  
  32.   Set Variable * test from Expression "CharCount('a','abracadabra')"
  33.  
  34. The above example will make test equal to 5, since there are five a's in the word 'abracadabra'.
  35.